{% extends 'register/base.html' %}
{% load admin_list i18n %}
{% block title %}<title>:: duetopia :: {% trans 'query results' %}</title>{% endblock %}
{% block script %}
<script src="{{ baseurl }}static/OpenLayers.js"></script>
<script type="text/javascript">
	function init() {
		divs = document.getElementsByTagName("div");
		for (i=0; i<divs.length; i++) {
			if (divs[i].className == "list_map") {
				kmlurl = divs[i].innerHTML;
				divs[i].innerHTML = "";
				map = new OpenLayers.Map(divs[i].id, { 'controls' : [] });
				basemap = new OpenLayers.Layer.WMS("vmap0","{{ tilecache }}", { layers : "basic" });
				map.addLayer(basemap);
				kml = new OpenLayers.Layer.GML("{{ object }}",
					kmlurl,
					{
						format: OpenLayers.Format.KML,
						formatOptions: {
							extractStyles: true,
							extractAttributes: false
						}
					}
				);
				map.addLayer(kml);
				map.zoomToMaxExtent();
			}
		}
	}
</script>
{% endblock %}
{% block content %}
<div class="changelist">
<h2>{% trans 'query results' %}: {{model.verbose_name}}</h2>
{% block search %}{% search_form cl %}{% endblock %}
<p><a href="{{ baseurl }}dataset/search/">{% trans 'expand search' %}</a></p>
{% block filters %}{% filters cl %}{% endblock %}
{% block result_list %}{% result_list cl %}{% endblock %}
{% block pagination %}{% pagination cl %}{% endblock %}
</div>
{% endblock %}
